package algorithm;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class CountDoubleTime {
    public static void main(String[] args) {
        int count = 0;
        int[] input = new int[]{1,4,3,2,9,7,18,22,0};
        Arrays.sort(input);
        for (int i = 0; i < input.length; i++) {
            for (int j = i+1; j < input.length; j++) {
                if(input[j] == input[i] * 2) {
                    count++;
                }
            }
        }

        System.out.println(count);
    }
}
